home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / ShareMailGiftware / AmigaTalk / system / Exec.st < prev    next >
Text File  |  2002-10-27  |  6KB  |  194 lines

  1. " -------------------------------------------------------------------------- "
  2. " Executive Class allows the User access to the functions from exec.library. "
  3. " If you do not know what they do, expect your System to freeze up solid!!   "
  4. ""
  5. " Primitive methods pertaining to MsgPorts have been moved to MsgPort.st     "
  6. " -------------------------------------------------------------------------- "
  7.  
  8. Class Executive :Object
  9. [
  10.    initCode: startClass version: versionNum
  11.       <primitive 209 4 25 startClass versionNum>
  12. |
  13.    initStruct: initTableObj with: memoryObj size: size
  14.       <primitive 209 4 26 initTableObj memoryObj size>
  15. |
  16.    makeFunctionsIn: targetObj with: funcArrayObj displacement: funcDispBase
  17.       <primitive 209 4 28 targetObj funcArrayObj funcDispBase>
  18. |
  19.    findResidentNamed: nameString
  20.       ^ <primitive 209 4 29 nameString>
  21. |
  22.    initResident: residentObj segments: segList
  23.       ^ <primitive 209 4 30 residentObj segList>
  24. |
  25.    alertDisplay: alertNumber
  26.       " Use the Alert Class instead!! "
  27.       <primitive 209 4 31 alertNumber>
  28. |
  29.    callDebug: dbgFlags
  30.       <primitive 209 4 32 dbgFlags>
  31. |
  32.    createIORequest: msgPortObj size: size
  33.       ^ <primitive 209 4 49 msgPortObj size>
  34. |
  35.    deleteIORequest: ioRequestObj
  36.       <primitive 209 4 50 ioRequestObj>
  37. |
  38.    addDevice: deviceObj
  39.       <primitive 209 4 51 deviceObj>
  40. |
  41.    removeDevice: deviceObj
  42.       <primitive 209 4 52 deviceObj>
  43. |
  44.    doIO: ioRequestObj
  45.       ^ <primitive 209 4 53 ioRequestObj>
  46. |
  47.    sendIO: ioRequestObj
  48.       <primitive 209 4 54 ioRequestObj>
  49. |
  50.    checkIO: ioRequestObj
  51.       ^ <primitive 209 4 55 ioRequestObj>
  52. |
  53.    waitIO: ioRequestObj
  54.       ^ <primitive 209 4 56 ioRequestObj>
  55. |
  56.    abortIO: ioRequestObj
  57.       <primitive 209 4 57 ioRequestObj>
  58. |
  59.    addResource: resourceObj
  60.       <primitive 209 4 58 resourceObj>
  61. |
  62.    removeResource: resourceObj
  63.       <primitive 209 4 59 resourceObj>
  64. |
  65.    openResource: resourceName
  66.       ^ <primitive 209 4 60 resourceName>
  67. |
  68.    getConditionCodes
  69.       ^ <primitive 209 4 61>
  70. |
  71.    sumKickData
  72.       ^ <primitive 209 4 75>
  73. |
  74.    addMemList: size attrs: attributes priority: pri base: baseObj named: name
  75.       <primitive 209 4 76 size attributes pri baseObj name>
  76. |
  77.    cacheClearU
  78.       <primitive 209 4 77>
  79. |
  80.    cacheClearE: addressObj length: length caches: caches
  81.       <primitive 209 4 78 addressObj length caches>
  82. |
  83.    cacheControl: cacheBits with: cacheMask
  84.       ^ <primitive 209 4 79 cacheBits cacheMask>
  85. |
  86.    coldReboot
  87.       <primitive 209 4 85>
  88. |
  89.    stackSwap: stackSwapStructObj
  90.       <primitive 209 4 86 stackSwapStructObj>
  91. |
  92.    rawDoFormat: fmtStr to: dataStreamObj renderFunction: putChFuncObj data: putChData
  93.       ^ <primitive 209 4 87 fmtStr dataStreamObj putChFuncObj putChData>
  94. |
  95.    addMemHandler: interruptObj
  96.       <primitive 209 4 88 interruptObj>
  97. |
  98.    removeMemHandler: interruptObj
  99.       <primitive 209 4 89 interruptObj>
  100. ]
  101.  
  102.  
  103. " to be added later:
  104. **  ULONG Supervisor( ULONG (* CONST userFunction)() );
  105.  
  106. **  These are just asking for trouble!!:
  107. **  VOID  Disable( VOID ); // Disables interrupts & task-switching!
  108. **  VOID  Enable( VOID );
  109. **  VOID  Forbid( VOID );  // Task switching only, NOT interrupts!
  110. **  VOID  Permit( VOID );
  111.  
  112. **  ULONG SetSR( ULONG newSR, ULONG mask );
  113. **  APTR  SuperState( VOID );
  114. **  VOID  UserState( APTR sysStack );
  115. **
  116. **  struct Interrupt *SetIntVector( LONG intNumber, 
  117. **                                  CONST struct Interrupt *interrupt
  118. **                                );
  119. **
  120. **  VOID  AddIntServer( LONG intNumber, struct Interrupt *interrupt );
  121. **  VOID  RemIntServer( LONG intNumber, struct Interrupt *interrupt );
  122. **  VOID  Cause( struct Interrupt *interrupt );
  123. **  APTR  CachePreDMA( CONST APTR address, ULONG *length, ULONG flags );
  124. **  VOID  CachePostDMA( CONST APTR address, ULONG *length, ULONG flags );
  125. **  ULONG ObtainQuickVector( APTR interruptCode );
  126. **  LONG  AllocTrap( LONG trapNum );
  127. **  VOID  FreeTrap( LONG trapNum );
  128. "
  129.  
  130. " ----------------------------------------------------------------------- "
  131. " AVLTree Class implements some new Exec functions in OS3.9.              "
  132. ""
  133. " WARNING "
  134. "   The compareKeyFuncObj might be broken, since the AutoDocs are as clear"
  135. "   as mud. "
  136. " ----------------------------------------------------------------------- "
  137.  
  138. Class AVLTree :Object ! compareFuncObj compareKeyFuncObj !
  139. [
  140.    addAVLNode: avlNodeObj to: avlRootNode function: funcObj 
  141.       ^ <primitive 209 4 91 avlRootNode avlNodeObj funcObj>
  142. |
  143.    removeAVLNode: avlNodeObj from: avlRootNode
  144.       ^ <primitive 209 4 92 avlRootNode avlNodeObj>
  145. |
  146.    removeAVLNode: avlKeyObj from: avlRootNode function: funcObj
  147.       ^ <primitive 209 4 93 avlRootNode avlKeyObj funcObj>
  148. |
  149.    findAVLNode: avlKeyObj in: avlRootNode function: funcObj
  150.       ^ <primitive 209 4 94 avlRootNode avlKeyObj funcObj>
  151. |
  152.    findPrevAVLNode: avlNodeObj
  153.       ^ <primitive 209 4 95 avlNodeObj>
  154. |
  155.    findPrevAVLNode: avlKeyObj in: avlRootNode function: funcObj
  156.       ^ <primitive 209 4 96 avlRootNode avlKeyObj funcObj>
  157. |
  158.    findNextAVLNode: avlNodeObj
  159.       ^ <primitive 209 4 97 avlNodeObj>
  160. |
  161.    findNextAVLNode: avlKeyObj in: avlRootNode function: funcObj
  162.       ^ <primitive 209 4 98 avlRootNode avlKeyObj funcObj>
  163. |
  164.    findFirstAVLNode: avlRootNode
  165.       ^ <primitive 209 4 99 avlRootNode>
  166. |
  167.    findLastAVLNode: avlRootNode
  168.       ^ <primitive 209 4 100 avlRootNode>
  169. |
  170.    getDefaultCompareFunction
  171.       " Use the return from this method for funcObj in 
  172.       * addAVLNode:to:function: method.
  173.       "
  174.       ^ compareFuncObj <- <primitive 209 4 103>
  175. |
  176.    getDefaultKeyCompareFunction
  177.       " See WARNING above "
  178.       ^ compareKeyFuncObj <- <primitive 209 4 104>
  179. |
  180.    avlNodeCompare: avlNode1 with: avlNode2
  181.       " Note that the compare function works like strcmp() by returning
  182.       * < 0, 0, > 0 results to define a less/equal/greater relationship.
  183.       * However, this method can also return nil if either argument is nil.
  184.       "
  185.       ^ <primitive 209 4 101 avlNode1 avlNode2>
  186. |
  187.    avlKeyCompare: avlKey1 with: avlKey2
  188.       " Note that the compare function works like strcmp() by returning
  189.       * < 0, 0, > 0 results to define a less/equal/greater relationship.
  190.       "
  191.       ^ <primitive 209 4 102 avlKey1 avlKey2>
  192. ]
  193.  
  194.